export default function TimeTurn<T>(date: T, type:any) {
    if (typeof date == "string" || typeof date == "number") {
        let lowdete: Date = new Date(date);
        let nian = lowdete.getFullYear();
        let yue = (lowdete.getMonth() + 1).toString();
        let ri = lowdete.getDate().toString();
        let shi = lowdete.getHours().toString();
        let fen = lowdete.getMinutes().toString();
        let miao = lowdete.getSeconds().toString();
        if (Number(ri) < 10) {
            ri = "0" + ri;
        }
        if (Number(yue) < 10) {
            yue = "0" + yue;
        }
        if (Number(shi) < 10) {
            shi = "0" + shi;
        }
        if (Number(fen) < 10) {
            fen = "0" + fen;
        }
        if (Number(miao) < 10) {
            miao = "0" + miao;
        }
        if (type == 2) {
            return nian + "." + yue + "." + ri + " " + shi + ":" + fen + ":" + miao
        } else {
            return nian + "." + yue + "." + ri
        }


    }

}